package com.sz.web.common.initialize;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.context.event.ApplicationPreparedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * 项目启动
 */
@Component
@Order(value = 1)
public class MyApplicationRunner implements ApplicationRunner {
    @Resource
    private AccountInit accountInit;
    @Resource
    private FunctionInit functionInit;

    /**
     * 初始化
     *
     * @param args
     * @throws Exception
     */
    @Override
    public void run(ApplicationArguments args) throws Exception {
        //初始化管理员
        accountInit.managerInit();
        functionInit.funciontUrlInit();
    }
}
